--[[
  这个写法 废弃了，请用 `RxMuitlColor`
  ----------------------------
  ----------------------------
  ----------------------------
  判断 颜色 是否存在

  https://helpdoc.touchsprite.com/dev_docs/17/9.html

]]
local options = {
  ["dim"] = 90,
  ["flag"] = false
}
function RxLoopRgbTouch(rtable, isTouch)
  local ctn = 0
  if multiColor(rtable, options) == true then
    ctn = 1
    if isTouch then
      local index = 0, 0, 1

      local minx, miny, maxx, maxy = 0, 0, 0, 0
      while rtable[index] ~= nil do
        local x = rtable[index][1]
        local y = rtable[index][2]
        -- C语言：   x = a  ?  b :  c
        -- Lua语言： x = a and b or c
        minx = minx > x and x or minx
        miny = miny > y and y or miny
        maxx = maxx < x and x or maxx
        maxy = maxy < y and y or maxy
        index = index + 1
      end

      local stepx = math.floor((maxx - minx) / 2)
      local stepy = math.floor((maxy - miny) / 2)
      RxTouch(minx + stepx, miny + stepy)
    end
  end
  return ctn
end
function RxLoopRgb(rtable)
  return RxLoopRgbTouch(rtable, false)
end
